<?php

include_once "xAP-functions/webincludes.php";

$ip=$_SERVER["REMOTE_ADDR"];
$col=intval($_GET["id"]);

$sql="select xAP_Widget_Location.LocationID,xAP_Widget_Location.ColumnRef,xAP_Widget_Location.ExtraData,
xAP_Widget_Library.Module,xAP_Widget_Library.URL,xAP_Widget_Library.URLConfig from xAP_Widget_Location inner join xAP_Widget_Library on
xAP_Widget_Location.WidgetID=xAP_Widget_Library.WidgetID

where xAP_Widget_Location.IP='".$ip."' and xAP_Widget_Location.ColumnRef=".$col." 
order by WidgetOrder";

$results=dbquery($sql);

$origpath=$config["modulefolder"];
foreach($results as $row){
	$tmp=explode("/",$row["Widget"]);
	$config["modulefolder"]=$row["Module"];
	if($row["URLConfig"]!=""){
		$config["widgetconfig"]=1;
		}else{
		$config["widgetconfig"]=0;
		}
	$extradata=unserialize($row["ExtraData"]);
	$widgetID=$row["LocationID"];
	$body="";$title="";
	include "../".$row["Module"]."/".$row["URL"]."";
}

?>